#include<iostream>

void swap(int *a, int *b)
{
    int temp = *a;
    *a = *b;
    *b = temp;

}

void swap(int &a, int &b)
{
    int temp = a;
    a = b;
    b = temp;


}

int main()
{
    // int a= 20; 
    // int &b = a; //b=10 &引用 定义必须初始化  引用在初始化后不在改变朝向

    // int c = 20;
    // b = c;
    // std::cout<<a<<std::endl;//a 20 


    //int b = 10;
    //swap(&a, &b);
    //std::cout<<a<<","<<b<<std::endl;

    int a = 10;
    int b = 20;
    swap(a, b);

    return 0;
}